package com.gitee.cirnochat.login.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.cirnochat.login.model.enums.DeviceType;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 登陆历史
 * @TableName login_history
 */
@TableName(value ="login_history")
@Data
public class LoginHistory implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 设备ID
     */
    @TableField(value = "device_id")
    private String deviceId;

    /**
     * 设备名称
     */
    @TableField(value = "device_name")
    private String deviceName;

    /**
     * 设备类型
     */
    @TableField(value = "device_type")
    private DeviceType deviceType;

    /**
     * IP地址
     */
    @TableField(value = "ip_address")
    private String ipAddress;

    /**
     * IP地址描述
     */
    @TableField(value = "ip_description")
    private String ipDescription;

    /**
     * 用户代理
     */
    @TableField(value = "user_agent")
    private String userAgent;

    /**
     * 是否登陆成功 0:失败 1:成功
     */
    @TableField(value = "status")
    private Integer status;

    /**
     * 登陆时间
     */
    @TableField(value = "login_time")
    private LocalDateTime loginTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}